package com.lishui.waterojbackendmodel.model.pojo.dto;

import com.lishui.waterojbackendcommon.contant.MessageConstant;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 用户注册请求体
 *
 */
@Data
public class UserRegisterDTO implements Serializable {

    private static final long serialVersionUID = 3191241716373120793L;

    /**
     * 用户账号
     */
    @NotEmpty(message = MessageConstant.ACCOUNT_IS_NULL)
    @Size(min = 5, max = 12, message = MessageConstant.ACCOUNT_LENGTH_ERROR)
    private String userAccount;

    /**
     * 用户密码
     */
    @NotEmpty(message = MessageConstant.PASSWORD_IS_NULL)
    @Size(min = 5, max = 15, message = MessageConstant.PASSWORD_LENGTH_ERROR)
    private String userPassword;

    /**
     * 校验密码
     */
    @NotEmpty(message = MessageConstant.CHECK_PASSWORD_IS_NULL)
    @Size(min = 5, max = 15, message = MessageConstant.CHECK_PASSWORD_LENGTH_ERROR)
    private String checkPassword;

    /**
     * 用户昵称
     */
    @NotEmpty(message = "用户名不能为空")
    private String username;

    /**
     * 电话
     */
    @NotEmpty(message = "电话不能为空")
    @Size(max = 11, min = 8, message = MessageConstant.PHONE_FORMAT_ERROR)
    private String phone;

    /**
     * 邮箱
     */
    @NotEmpty(message = "邮箱不能为空")
    @Email(message = MessageConstant.EMAIL_FORMAT_ERROR)
    private String email;
}
